/**************************************************************************
 * @doc CPAC
 * @module CPAC.H |  
 * Include file for the CPAC data file and functions.
 *
 * Product         :  SoftPay 2000 (Global Payment Methodology).
 * <nl>Developer   :  Vipin_K1
 * <nl>Notes       :
 *
 * @head3 CPAC Functions |
 * @index | CPAC
 * @end
 *
 * Copyright (c) 1996-2000 by VeriFone Inc. All rights reserved.
 * 
 * No part of this software may be used, stored, compiled, reproduced,
 * modified, transcribed, translated, transmitted, or transferred, in any form 
 * or by any means whether electronic, mechanical, magnetic, optical, 
 * or otherwise, without the express prior written permission of VeriFone, Inc.
 *
 * Revision History
 * ------------------------------------------------------------------------
$Log: /SoftPay/SPK2SIM/Source/CPACSrc/CPAC.h $
 * 
 * ------------------------------------------------------------------------
 ********************************************************************************/

#ifndef CPAC_H
#define CPAC_H

extern int inTotalTransAmtAlwd(TRANSACTION_OBJECT* pobTran);
extern int inCPACTransAmtUpdate(TRANSACTION_OBJECT* pobTran);
extern int inChkTransAlwd(TRANSACTION_OBJECT* pobTran,VS_BOOL fChkCPACUpdate);
extern void vdGetCPACAmtAlwd(char* pchTotAmtAllwd);
extern void vdGetCPACPresentAmt(char* pchPresentAmt);
extern void vdSetCPACPresentAmt(char* pchPresentAmt);
extern void vdGetCPACCurDate(char* pchCurDate);
extern void vdSetCPACCurDate(char* pchCurDate);
extern VS_BOOL fGetCPACRRNPrint(void);
extern void vdSetCPACRRNPrint(int);
extern VS_BOOL fGetCPACUsrInvNum(void);
extern void vdSetCPACUsrInvNum(int);
extern void vdSetCPACMaxAmtEntryDigits(short inMaxAmtEntryDigits);
extern int inGetCPACMaxAmtEntryDigits(void);
extern VS_BOOL fGetCPACMerchEnable(void);//saritha
extern void vdSetCPACMerchEnable(int);//saritha

extern VS_BOOL fGetCPACMaskPANinMRcpt(void);//Kelvin_F2
extern void vdSetCPACMaskPANinMRcpt(int);//Kelvin_F2
extern VS_BOOL fGetCPACMaskPANinCRcpt(void);//Kelvin_F2
extern void vdSetCPACMaskPANinCRcpt(int);//Kelvin_F2
extern VS_BOOL fGetCPACMaskPANinBRcpt(void);//Kelvin_F2
extern void vdSetCPACMaskPANinBRcpt(int);//Kelvin_F2
extern  VS_BOOL fGetCPACStanInc(void) ; // Saritha_b1
extern void vdSetCPACStanInc(int inStanInc) ;   // Saritha_b1

extern char* szGetCPACTID(void);   //sowmya
extern char* szGetCPACMID(void);  //sowmya
extern char* szGetCPACNII(void);  //sowmya
extern char* szGetCPACTPDU(void);  //sowmya

extern void vdSetCPACTID(const char* szCPACTID);  //sowmya
extern void vdSetCPACMID(const char* szCPACMID);  //sowmya
extern void vdSetCPACNII(char* szCPACNII);  //sowmya
extern void vdSetCPACTPDU(char* szCPACTPDU); //sowmya



extern void vdGetCPACPassword1(char* pchPass1);
extern void vdSetCPACPassword1(char* pchPass1);
extern void vdGetCPACPassword2(char* pchPass2);
extern void vdSetCPACPassword2(char* pchPass2);
extern void vdGetCPACPassword3(char* pchPass3);
extern void vdSetCPACPassword3(char* pchPass3);
extern void vdGetCPACPassword4(char* pchPass4);
extern void vdSetCPACPassword4(char* pchPass4);
extern void vdGetCPACPassword5(char* pchPass5);
extern void vdSetCPACPassword5(char* pchPass5);

#define CPAC_FILE_NAME                      "CPAC.DAT" 

typedef struct TagCPAC {
    short inTimeGap;                     /* Time Gap in HH for next Auto Settlement */
    short inMaxAmtEntryDigits;           /* Max. Amt. Entry Digits */
    char szCPACTID[CPAC_TERM_ID_SIZE + 1];
    char szCPACMID[CPAC_MERCH_ID_SIZE + 1];
    char szCPACTPDU[CPAC_TPDU_SIZE + 1];
    char szCPACNII[CPAC_NII_SIZE + 1];
    char szCPACDescCode[CPAC_PVT_61_SIZE + 1];
    char szCPACAutoSettleDtTm[CPAC_DATE_TIME_SIZE + 1]; /* The date/time you want to autosettle */
    char szRefPhone[PHONE_NUM_SIZE + 1]; /* Refferal Phone Num to call */
    char szAmtAlwd[AMT_SIZE + 1];        /* Max Amount Limit per Day */
    char szPresentAmt[AMT_SIZE + 1];     /* Present Rolling Amt per Day */
    char szDate[DATE_SIZE + 1];          /* Date for checking */
    char szPassword1[PASSWORD_SIZE + 1];
    char szPassword2[PASSWORD_SIZE + 1];
    char szPassword3[PASSWORD_SIZE + 1];
    char szPassword4[PASSWORD_SIZE + 1];
    char szPassword5[PASSWORD_SIZE + 1];
    char szDummy[1 + 1];
   
#ifdef _WINDOWS
    int fUnused1 : 1;     /* Reserved Bits */
    int fUnused2 : 1;     /* Reserved Bits */
    int fUnused3 : 1;     /* Reserved Bits */
    int fUnused4 : 1;     /* Reserved Bits */
    int fUnused5 : 1;     /* Reserved Bits */
    int fUnused6 : 1;     /* Reserved Bits */
    int fUnused7 : 1;     /* Reserved Bits */
    int fUnused8 : 1;     /* Reserved Bits */
    int fUnused9 : 1;     /* Reserved Bits */
    int fUnused10 : 1;     /* Reserved Bits */
    int fUnused11 : 1;     /* Reserved Bits */
    int fUnused12 : 1;     /* Reserved Bits */
    int fUnused13 : 1;     /* Reserved Bits */
    int fUnused14 : 1;     /* Reserved Bits */
    int fUnused15 : 1;     /* Reserved Bits */
    int fUnused16 : 1;     /* Reserved Bits */
#else 
    int fUnused1 : 1;     /* Reserved Bits */
    int fUnused2 : 1;     /* Reserved Bits */
    int fUnused3 : 1;     /* Reserved Bits */
    int fUnused4 : 1;     /* Reserved Bits */
    int fUnused5 : 1;     /* Reserved Bits */
    int fUnused6 : 1;     /* Reserved Bits */
    int fUnused7 : 1;     /* Reserved Bits */
    int fUnused8 : 1;     /* Reserved Bits */
    int fUnused9 : 1;     /* Reserved Bits */
    int fUnused10 : 1;     /* Reserved Bits */
    int fUnused11 : 1;     /* Reserved Bits */
    int fUnused12 : 1;     /* Reserved Bits */
    int fUnused13 : 1;     /* Reserved Bits */
    int fUnused14 : 1;     /* Reserved Bits */
    int fUnused15 : 1;     /* Reserved Bits */
    int fUnused16 : 1;     /* Reserved Bits */
    int fUnused17 : 1;     /* Reserved Bits */
    int fUnused18 : 1;     /* Reserved Bits */
    int fUnused19 : 1;     /* Reserved Bits */
    int fUnused20 : 1;     /* Reserved Bits */
    int fUnused21 : 1;     /* Reserved Bits */
    int fUnused22 : 1;     /* Reserved Bits */
    int fUnused23 : 1;     /* Reserved Bits */
    int fMaskMid: 1;     /* Reserved Bits */
    int fMaskTid : 1;     /* Reserved Bits */
    int fStanInc : 1;     /* Reserved Bits */
    int fMaskPANinMRcpt : 1;     /* Reserved Bits */
    int fMaskPANinCRcpt : 1;      /* Reserved Bits */
    int fMaskPANinBRcpt : 1;     /* Reserved Bits */
    int fMerchEnable : 1;     /* Reserved Bits */ //saritha
    int fRRNPrint : 1;     /* Reserved Bits */
    int fUsrInvNum : 1;     /* Reserved Bits */
#endif
}CPAC_REC;

extern CPAC_REC srCPAC;
extern int inSaveCPACRec(CPAC_REC* psrCPAC);

#endif /*CPAC_H*/
